        <!DOCTYPE html>
        <html>
        <head>
                <meta charset="utf-8">
        <title>mat2 class / vector_math Library / Dart Documentation</title>
        <link rel="stylesheet" type="text/css"
            href="../styles.css">
        <link href="http://fonts.googleapis.com/css?family=Open+Sans:400,600,700,800" rel="stylesheet" type="text/css">
        <link rel="shortcut icon" href="../favicon.ico">
        
        </head>
        <body data-library="vector_math" data-type="mat2">
        <div class="page">
        <div class="header">
          <a href="../index.html"><div class="logo"></div></a>
          <a href="../index.html">Dart Documentation</a>
         &rsaquo; <a href="../vector_math.html">vector_math</a> &rsaquo; <a href="../vector_math/mat2.html">mat2</a>        <div id="search-box">
          <input type="search" name="q" id="q" autocomplete="off"
              class="search-input" placeholder="Search API">
        </div>
        
      </div>
      <div class="drop-down" id="drop-down"></div>
      
        <div class="nav">
        
</div>
<div class="content">
        <h2><strong>mat2</strong>
          class
        </h2>
        
<button id="show-inherited" class="show-inherited">Hide inherited</button>
<div class="doc">
<p>mat2 is a column major matrix where each column is represented by <a class="crossref" href="../vector_math/vec2.html">vec2</a>. This matrix has 2 columns and 2 rows.</p>
<pre class="source">
class mat2 {
 vec2 col0;
 vec2 col1;
 /// Constructs a new mat2. Supports GLSL like syntax so many possible inputs. Defaults to identity matrix.
 mat2([dynamic arg0, dynamic arg1, dynamic arg2, dynamic arg3]) {
   //Initialize the matrix as the identity matrix
   col0 = new vec2.zero();
   col1 = new vec2.zero();
   col0.x = 1.0;
   col1.y = 1.0;
   if (arg0 is num &amp;&amp; arg1 is num &amp;&amp; arg2 is num &amp;&amp; arg3 is num) {
     col0.x = arg0;
     col0.y = arg1;
     col1.x = arg2;
     col1.y = arg3;
     return;
   }
   if (arg0 is num &amp;&amp; arg1 == null &amp;&amp; arg2 == null &amp;&amp; arg3 == null) {
     col0.x = arg0;
     col1.y = arg0;
     return;
   }
   if (arg0 is vec2 &amp;&amp; arg1 is vec2) {
     col0 = arg0;
     col1 = arg1;
     return;
   }
   if (arg0 is mat2) {
     col0 = arg0.col0;
     col1 = arg0.col1;
     return;
   }
   if (arg0 is vec2 &amp;&amp; arg1 == null &amp;&amp; arg2 == null &amp;&amp; arg3 == null) {
     col0.x = arg0.x;
     col1.y = arg0.y;
   }
 }
 /// Constructs a new [mat2] from computing the outer product of [u] and [v].
 mat2.outer(vec2 u, vec2 v) {
   col0 = new vec2.zero();
   col1 = new vec2.zero();
   col0.x = u.x * v.x;
   col0.y = u.x * v.y;
   col1.x = u.y * v.x;
   col1.y = u.y * v.y;
 }
 /// Constructs a new [mat2] filled with zeros.
 mat2.zero() {
   col0 = new vec2.zero();
   col1 = new vec2.zero();
   col0.x = 0.0;
   col0.y = 0.0;
   col1.x = 0.0;
   col1.y = 0.0;
 }
 /// Constructs a new identity [mat2].
 mat2.identity() {
   col0 = new vec2.zero();
   col1 = new vec2.zero();
   col0.x = 1.0;
   col1.y = 1.0;
 }
 /// Constructs a new [mat2] which is a copy of [other].
 mat2.copy(mat2 other) {
   col0 = new vec2.zero();
   col1 = new vec2.zero();
   col0.x = other.col0.x;
   col0.y = other.col0.y;
   col1.x = other.col1.x;
   col1.y = other.col1.y;
 }
 /// Constructs a new [mat2] representing a rotation by [radians].
 mat2.rotation(num radians_) {
   col0 = new vec2.zero();
   col1 = new vec2.zero();
   setRotation(radians_);
 }
 mat2.raw(num arg0, num arg1, num arg2, num arg3) {
   col0 = new vec2.zero();
   col1 = new vec2.zero();
   col0.x = arg0;
   col0.y = arg1;
   col1.x = arg2;
   col1.y = arg3;
 }
 /// Returns a printable string
 String toString() {
   String s = '';
   s = '$s[0] ${getRow(0)}\n';
   s = '$s[1] ${getRow(1)}\n';
   return s;
 }
 /// Returns the number of rows in the matrix.
 int get rows =&gt; 2;
 /// Returns the number of columns in the matrix.
 int get cols =&gt; 2;
 /// Returns the number of columns in the matrix.
 int get length =&gt; 2;
 /// Gets the [column] of the matrix
 vec2 operator[](int column) {
   assert(column &gt;= 0 &amp;&amp; column &lt; 2);
   switch (column) {
     case 0: return col0;
     case 1: return col1;
   }
   throw new ArgumentError(column);
 }
 /// Assigns the [column] of the matrix [arg]
 void operator[]=(int column, vec2 arg) {
   assert(column &gt;= 0 &amp;&amp; column &lt; 2);
   switch (column) {
     case 0: col0 = arg; break;
     case 1: col1 = arg; break;
   }
   throw new ArgumentError(column);
 }
 /// Returns row 0
 vec2 get row0 =&gt; getRow(0);
 /// Returns row 1
 vec2 get row1 =&gt; getRow(1);
 /// Sets row 0 to [arg]
 set row0(vec2 arg) =&gt; setRow(0, arg);
 /// Sets row 1 to [arg]
 set row1(vec2 arg) =&gt; setRow(1, arg);
 /// Assigns the [column] of the matrix [arg]
 void setRow(int row, vec2 arg) {
   assert(row &gt;= 0 &amp;&amp; row &lt; 2);
   col0[row] = arg.x;
   col1[row] = arg.y;
 }
 /// Gets the [row] of the matrix
 vec2 getRow(int row) {
   assert(row &gt;= 0 &amp;&amp; row &lt; 2);
   vec2 r = new vec2.zero();
   r.x = col0[row];
   r.y = col1[row];
   return r;
 }
 /// Assigns the [column] of the matrix [arg]
 void setColumn(int column, vec2 arg) {
   assert(column &gt;= 0 &amp;&amp; column &lt; 2);
   this[column] = arg;
 }
 /// Gets the [column] of the matrix
 vec2 getColumn(int column) {
   assert(column &gt;= 0 &amp;&amp; column &lt; 2);
   return new vec2.copy(this[column]);
 }
 /// Returns a new vector or matrix by multiplying [this] with [arg].
 dynamic operator*(dynamic arg) {
   if (arg is num) {
     mat2 r = new mat2.zero();
     r.col0.x = col0.x * arg;
     r.col0.y = col0.y * arg;
     r.col1.x = col1.x * arg;
     r.col1.y = col1.y * arg;
     return r;
   }
   if (arg is vec2) {
     vec2 r = new vec2.zero();
     r.x =  (this.col0.x * arg.x) + (this.col1.x * arg.y);
     r.y =  (this.col0.y * arg.x) + (this.col1.y * arg.y);
     return r;
   }
   if (2 == arg.rows) {
     dynamic r = null;
     if (arg.cols == 2) {
       r = new mat2.zero();
       r.col0.x =  (this.col0.x * arg.col0.x) + (this.col1.x * arg.col0.y);
       r.col1.x =  (this.col0.x * arg.col1.x) + (this.col1.x * arg.col1.y);
       r.col0.y =  (this.col0.y * arg.col0.x) + (this.col1.y * arg.col0.y);
       r.col1.y =  (this.col0.y * arg.col1.x) + (this.col1.y * arg.col1.y);
       return r;
     }
     return r;
   }
   throw new ArgumentError(arg);
 }
 /// Returns new matrix after component wise [this] + [arg]
 mat2 operator+(mat2 arg) {
   mat2 r = new mat2.zero();
   r.col0.x = col0.x + arg.col0.x;
   r.col0.y = col0.y + arg.col0.y;
   r.col1.x = col1.x + arg.col1.x;
   r.col1.y = col1.y + arg.col1.y;
   return r;
 }
 /// Returns new matrix after component wise [this] - [arg]
 mat2 operator-(mat2 arg) {
   mat2 r = new mat2.zero();
   r.col0.x = col0.x - arg.col0.x;
   r.col0.y = col0.y - arg.col0.y;
   r.col1.x = col1.x - arg.col1.x;
   r.col1.y = col1.y - arg.col1.y;
   return r;
 }
 /// Returns new matrix -this
 mat2 operator-() {
   mat2 r = new mat2.zero();
   r[0] = -this[0];
   r[1] = -this[1];
   return r;
 }
 /// Zeros [this].
 mat2 setZero() {
   col0.x = 0.0;
   col0.y = 0.0;
   col1.x = 0.0;
   col1.y = 0.0;
   return this;
 }
 /// Makes [this] into the identity matrix.
 mat2 setIdentity() {
   col0.x = 1.0;
   col0.y = 0.0;
   col1.x = 0.0;
   col1.y = 1.0;
   return this;
 }
 /// Returns the tranpose of this.
 mat2 transposed() {
   mat2 r = new mat2.zero();
   r.col0.x = col0.x;
   r.col0.y = col1.x;
   r.col1.x = col0.y;
   r.col1.y = col1.y;
   return r;
 }
 mat2 transpose() {
   double temp;
   temp = col1.x;
   col1.x = col0.y;
   col0.y = temp;
   return this;
 }
 /// Returns the component wise absolute value of this.
 mat2 absolute() {
   mat2 r = new mat2.zero();
   r.col0.x = col0.x.abs();
   r.col0.y = col0.y.abs();
   r.col1.x = col1.x.abs();
   r.col1.y = col1.y.abs();
   return r;
 }
 /// Returns the determinant of this matrix.
 double determinant() {
   return (col0.x * col1.y) - (col0.y*col1.x);
 }
 /// Returns the trace of the matrix. The trace of a matrix is the sum of the diagonal entries
 double trace() {
   double t = 0.0;
   t += col0.x;
   t += col1.y;
   return t;
 }
 /// Returns infinity norm of the matrix. Used for numerical analysis.
 double infinityNorm() {
   double norm = 0.0;
   {
     double row_norm = 0.0;
     row_norm += this[0][0].abs();
     row_norm += this[0][1].abs();
     norm = row_norm &gt; norm ? row_norm : norm;
   }
   {
     double row_norm = 0.0;
     row_norm += this[1][0].abs();
     row_norm += this[1][1].abs();
     norm = row_norm &gt; norm ? row_norm : norm;
   }
   return norm;
 }
 /// Returns relative error between [this] and [correct]
 double relativeError(mat2 correct) {
   mat2 diff = correct - this;
   double correct_norm = correct.infinityNorm();
   double diff_norm = diff.infinityNorm();
   return diff_norm/correct_norm;
 }
 /// Returns absolute error between [this] and [correct]
 double absoluteError(mat2 correct) {
   double this_norm = infinityNorm();
   double correct_norm = correct.infinityNorm();
   double diff_norm = (this_norm - correct_norm).abs();
   return diff_norm;
 }
 /// Invert the matrix. Returns the determinant.
 double invert() {
   double det = determinant();
   if (det == 0.0) {
     return 0.0;
   }
   double invDet = 1.0 / det;
   double temp = col0.x;
   col0.x = col1.y * invDet;
   col0.y = - col0.y * invDet;
   col1.x = - col1.x * invDet;
   col1.y = temp * invDet;
   return det;
 }
 /// Turns the matrix into a rotation of [radians]
 void setRotation(num radians) {
   double radians_ = radians.toDouble();
   double c = Math.cos(radians_);
   double s = Math.sin(radians_);
   col0.x = c;
   col0.y = s;
   col1.x = -s;
   col1.y = c;
 }
 /// Converts into Adjugate matrix and scales by [scale]
 mat2 scaleAdjoint(num scale) {
   double scale_ = scale.toDouble();
   double temp = col0.x;
   col0.x = col1.y * scale_;
   col1.x = - col1.x * scale_;
   col0.y = - col0.y * scale_;
   col1.y = temp * scale_;
   return this;
 }
 mat2 clone() {
   return new mat2.copy(this);
 }
 mat2 copyInto(mat2 arg) {
   arg.col0.x = col0.x;
   arg.col0.y = col0.y;
   arg.col1.x = col1.x;
   arg.col1.y = col1.y;
   return arg;
 }
 mat2 copyFrom(mat2 arg) {
   col0.x = arg.col0.x;
   col0.y = arg.col0.y;
   col1.x = arg.col1.x;
   col1.y = arg.col1.y;
   return this;
 }
 mat2 add(mat2 o) {
   col0.x = col0.x + o.col0.x;
   col0.y = col0.y + o.col0.y;
   col1.x = col1.x + o.col1.x;
   col1.y = col1.y + o.col1.y;
   return this;
 }
 mat2 sub(mat2 o) {
   col0.x = col0.x - o.col0.x;
   col0.y = col0.y - o.col0.y;
   col1.x = col1.x - o.col1.x;
   col1.y = col1.y - o.col1.y;
   return this;
 }
 mat2 negate() {
   col0.x = -col0.x;
   col0.y = -col0.y;
   col1.x = -col1.x;
   col1.y = -col1.y;
   return this;
 }
 mat2 multiply(mat2 arg) {
   final double m00 = col0.x;
   final double m01 = col1.x;
   final double m10 = col0.y;
   final double m11 = col1.y;
   final double n00 = arg.col0.x;
   final double n01 = arg.col1.x;
   final double n10 = arg.col0.y;
   final double n11 = arg.col1.y;
   col0.x =  (m00 * n00) + (m01 * n10);
   col1.x =  (m00 * n01) + (m01 * n11);
   col0.y =  (m10 * n00) + (m11 * n10);
   col1.y =  (m10 * n01) + (m11 * n11);
   return this;
 }
 mat2 transposeMultiply(mat2 arg) {
   double m00 = col0.x;
   double m01 = col0.y;
   double m10 = col1.x;
   double m11 = col1.y;
   col0.x =  (m00 * arg.col0.x) + (m01 * arg.col0.y);
   col1.x =  (m00 * arg.col1.x) + (m01 * arg.col1.y);
   col0.y =  (m10 * arg.col0.x) + (m11 * arg.col0.y);
   col1.y =  (m10 * arg.col1.x) + (m11 * arg.col1.y);
   return this;
 }
 mat2 multiplyTranspose(mat2 arg) {
   double m00 = col0.x;
   double m01 = col1.x;
   double m10 = col0.y;
   double m11 = col1.y;
   col0.x =  (m00 * arg.col0.x) + (m01 * arg.col1.x);
   col1.x =  (m00 * arg.col0.y) + (m01 * arg.col1.y);
   col0.y =  (m10 * arg.col0.x) + (m11 * arg.col1.x);
   col1.y =  (m10 * arg.col0.y) + (m11 * arg.col1.y);
   return this;
 }
 vec2 transform(vec2 arg) {
   double x_ =  (this.col0.x * arg.x) + (this.col1.x * arg.y);
   double y_ =  (this.col0.y * arg.x) + (this.col1.y * arg.y);
   arg.x = x_;
   arg.y = y_;
   return arg;
 }
 vec2 transformed(vec2 arg, [vec2 out=null]) {
   if (out == null) {
     out = new vec2.copy(arg);
   } else {
     out.copyFrom(arg);
   }
   return transform(out);
 }
 /// Copies [this] into [array] starting at [offset].
 void copyIntoArray(List&lt;num&gt; array, [int offset=0]) {
   int i = offset;
   array[i] = col0.x;
   i++;
   array[i] = col0.y;
   i++;
   array[i] = col1.x;
   i++;
   array[i] = col1.y;
   i++;
 }
 /// Copies elements from [array] into [this] starting at [offset].
 void copyFromArray(List&lt;num&gt; array, [int offset=0]) {
   int i = offset;
   col0.x = array[i].toDouble();
   i++;
   col0.y = array[i].toDouble();
   i++;
   col1.x = array[i].toDouble();
   i++;
   col1.y = array[i].toDouble();
   i++;
 }
}
</pre>
</div>
<div>
<h3>Constructors</h3>
<div class="method"><h4 id="mat2">
<button class="show-code">Code</button>
new <strong>mat2</strong>([arg0, arg1, arg2, arg3]) <a class="anchor-link" href="#mat2"
              title="Permalink to mat2.mat2">#</a></h4>
<div class="doc">
<p>Constructs a new mat2. Supports GLSL like syntax so many possible inputs. Defaults to identity matrix.</p>
<pre class="source">
mat2([dynamic arg0, dynamic arg1, dynamic arg2, dynamic arg3]) {
 //Initialize the matrix as the identity matrix
 col0 = new vec2.zero();
 col1 = new vec2.zero();
 col0.x = 1.0;
 col1.y = 1.0;
 if (arg0 is num &amp;&amp; arg1 is num &amp;&amp; arg2 is num &amp;&amp; arg3 is num) {
   col0.x = arg0;
   col0.y = arg1;
   col1.x = arg2;
   col1.y = arg3;
   return;
 }
 if (arg0 is num &amp;&amp; arg1 == null &amp;&amp; arg2 == null &amp;&amp; arg3 == null) {
   col0.x = arg0;
   col1.y = arg0;
   return;
 }
 if (arg0 is vec2 &amp;&amp; arg1 is vec2) {
   col0 = arg0;
   col1 = arg1;
   return;
 }
 if (arg0 is mat2) {
   col0 = arg0.col0;
   col1 = arg0.col1;
   return;
 }
 if (arg0 is vec2 &amp;&amp; arg1 == null &amp;&amp; arg2 == null &amp;&amp; arg3 == null) {
   col0.x = arg0.x;
   col1.y = arg0.y;
 }
}
</pre>
</div>
</div>
<div class="method"><h4 id="mat2.copy">
<button class="show-code">Code</button>
new <strong>mat2.copy</strong>(<a href="../vector_math/mat2.html">mat2</a> other) <a class="anchor-link" href="#mat2.copy"
              title="Permalink to mat2.mat2.copy">#</a></h4>
<div class="doc">
<p>Constructs a new <a class="crossref" href="../vector_math/mat2.html#mat2">mat2</a> which is a copy of 
<span class="param">other</span>.</p>
<pre class="source">
mat2.copy(mat2 other) {
 col0 = new vec2.zero();
 col1 = new vec2.zero();
 col0.x = other.col0.x;
 col0.y = other.col0.y;
 col1.x = other.col1.x;
 col1.y = other.col1.y;
}
</pre>
</div>
</div>
<div class="method"><h4 id="mat2.identity">
<button class="show-code">Code</button>
new <strong>mat2.identity</strong>() <a class="anchor-link" href="#mat2.identity"
              title="Permalink to mat2.mat2.identity">#</a></h4>
<div class="doc">
<p>Constructs a new identity <a class="crossref" href="../vector_math/mat2.html#mat2">mat2</a>.</p>
<pre class="source">
mat2.identity() {
 col0 = new vec2.zero();
 col1 = new vec2.zero();
 col0.x = 1.0;
 col1.y = 1.0;
}
</pre>
</div>
</div>
<div class="method"><h4 id="mat2.outer">
<button class="show-code">Code</button>
new <strong>mat2.outer</strong>(<a href="../vector_math/vec2.html">vec2</a> u, <a href="../vector_math/vec2.html">vec2</a> v) <a class="anchor-link" href="#mat2.outer"
              title="Permalink to mat2.mat2.outer">#</a></h4>
<div class="doc">
<p>Constructs a new <a class="crossref" href="../vector_math/mat2.html#mat2">mat2</a> from computing the outer product of 
<span class="param">u</span> and 
<span class="param">v</span>.</p>
<pre class="source">
mat2.outer(vec2 u, vec2 v) {
 col0 = new vec2.zero();
 col1 = new vec2.zero();
 col0.x = u.x * v.x;
 col0.y = u.x * v.y;
 col1.x = u.y * v.x;
 col1.y = u.y * v.y;
}
</pre>
</div>
</div>
<div class="method"><h4 id="mat2.raw">
<button class="show-code">Code</button>
new <strong>mat2.raw</strong>(num arg0, num arg1, num arg2, num arg3) <a class="anchor-link" href="#mat2.raw"
              title="Permalink to mat2.mat2.raw">#</a></h4>
<div class="doc">
<pre class="source">
mat2.raw(num arg0, num arg1, num arg2, num arg3) {
 col0 = new vec2.zero();
 col1 = new vec2.zero();
 col0.x = arg0;
 col0.y = arg1;
 col1.x = arg2;
 col1.y = arg3;
}
</pre>
</div>
</div>
<div class="method"><h4 id="mat2.rotation">
<button class="show-code">Code</button>
new <strong>mat2.rotation</strong>(num radians_) <a class="anchor-link" href="#mat2.rotation"
              title="Permalink to mat2.mat2.rotation">#</a></h4>
<div class="doc">
<p>Constructs a new <a class="crossref" href="../vector_math/mat2.html#mat2">mat2</a> representing a rotation by <a class="crossref" href="../vector_math.html#radians">radians</a>.</p>
<pre class="source">
mat2.rotation(num radians_) {
 col0 = new vec2.zero();
 col1 = new vec2.zero();
 setRotation(radians_);
}
</pre>
</div>
</div>
<div class="method"><h4 id="mat2.zero">
<button class="show-code">Code</button>
new <strong>mat2.zero</strong>() <a class="anchor-link" href="#mat2.zero"
              title="Permalink to mat2.mat2.zero">#</a></h4>
<div class="doc">
<p>Constructs a new <a class="crossref" href="../vector_math/mat2.html#mat2">mat2</a> filled with zeros.</p>
<pre class="source">
mat2.zero() {
 col0 = new vec2.zero();
 col1 = new vec2.zero();
 col0.x = 0.0;
 col0.y = 0.0;
 col1.x = 0.0;
 col1.y = 0.0;
}
</pre>
</div>
</div>
</div>
<div>
<h3>Properties</h3>
<div class="field"><h4 id="col0">
<button class="show-code">Code</button>
<a href="../vector_math/vec2.html">vec2</a>         <strong>col0</strong> <a class="anchor-link"
            href="#col0"
            title="Permalink to mat2.col0">#</a>
        </h4>
        <div class="doc">
<pre class="source">
col0
</pre>
</div>
</div>
<div class="field"><h4 id="col1">
<button class="show-code">Code</button>
<a href="../vector_math/vec2.html">vec2</a>         <strong>col1</strong> <a class="anchor-link"
            href="#col1"
            title="Permalink to mat2.col1">#</a>
        </h4>
        <div class="doc">
<pre class="source">
col1
</pre>
</div>
</div>
<div class="field"><h4 id="cols">
<button class="show-code">Code</button>
final int         <strong>cols</strong> <a class="anchor-link"
            href="#cols"
            title="Permalink to mat2.cols">#</a>
        </h4>
        <div class="doc">
<p>Returns the number of columns in the matrix.</p>
<pre class="source">
int get cols =&gt; 2;
</pre>
</div>
</div>
<div class="field"><h4 id="length">
<button class="show-code">Code</button>
final int         <strong>length</strong> <a class="anchor-link"
            href="#length"
            title="Permalink to mat2.length">#</a>
        </h4>
        <div class="doc">
<p>Returns the number of columns in the matrix.</p>
<pre class="source">
int get length =&gt; 2;
</pre>
</div>
</div>
<div class="method"><h4 id="row0">
<button class="show-code">Code</button>
<a href="../vector_math/vec2.html">vec2</a> <strong>get row0</strong> <a class="anchor-link" href="#row0"
              title="Permalink to mat2.get row0">#</a></h4>
<div class="doc">
<p>Returns row 0</p>
<pre class="source">
vec2 get row0 =&gt; getRow(0);
</pre>
</div>
</div>
<div class="method"><h4 id="row0=">
<button class="show-code">Code</button>
<strong>set row0</strong>(<a href="../vector_math/vec2.html">vec2</a> arg) <a class="anchor-link" href="#row0="
              title="Permalink to mat2.set row0">#</a></h4>
<div class="doc">
<p>Sets row 0 to 
<span class="param">arg</span></p>
<pre class="source">
set row0(vec2 arg) =&gt; setRow(0, arg);
</pre>
</div>
</div>
<div class="method"><h4 id="row1">
<button class="show-code">Code</button>
<a href="../vector_math/vec2.html">vec2</a> <strong>get row1</strong> <a class="anchor-link" href="#row1"
              title="Permalink to mat2.get row1">#</a></h4>
<div class="doc">
<p>Returns row 1</p>
<pre class="source">
vec2 get row1 =&gt; getRow(1);
</pre>
</div>
</div>
<div class="method"><h4 id="row1=">
<button class="show-code">Code</button>
<strong>set row1</strong>(<a href="../vector_math/vec2.html">vec2</a> arg) <a class="anchor-link" href="#row1="
              title="Permalink to mat2.set row1">#</a></h4>
<div class="doc">
<p>Sets row 1 to 
<span class="param">arg</span></p>
<pre class="source">
set row1(vec2 arg) =&gt; setRow(1, arg);
</pre>
</div>
</div>
<div class="field"><h4 id="rows">
<button class="show-code">Code</button>
final int         <strong>rows</strong> <a class="anchor-link"
            href="#rows"
            title="Permalink to mat2.rows">#</a>
        </h4>
        <div class="doc">
<p>Returns the number of rows in the matrix.</p>
<pre class="source">
int get rows =&gt; 2;
</pre>
</div>
</div>
</div>
<div>
<h3>Operators</h3>
<div class="method"><h4 id="[]">
<button class="show-code">Code</button>
<a href="../vector_math/vec2.html">vec2</a> <strong>operator []</strong>(int column) <a class="anchor-link" href="#[]"
              title="Permalink to mat2.operator []">#</a></h4>
<div class="doc">
<p>Gets the 
<span class="param">column</span> of the matrix</p>
<pre class="source">
vec2 operator[](int column) {
 assert(column &gt;= 0 &amp;&amp; column &lt; 2);
 switch (column) {
   case 0: return col0;
   case 1: return col1;
 }
 throw new ArgumentError(column);
}
</pre>
</div>
</div>
<div class="method"><h4 id="[]=">
<button class="show-code">Code</button>
void <strong>operator []=</strong>(int column, <a href="../vector_math/vec2.html">vec2</a> arg) <a class="anchor-link" href="#[]="
              title="Permalink to mat2.operator []=">#</a></h4>
<div class="doc">
<p>Assigns the 
<span class="param">column</span> of the matrix 
<span class="param">arg</span></p>
<pre class="source">
void operator[]=(int column, vec2 arg) {
 assert(column &gt;= 0 &amp;&amp; column &lt; 2);
 switch (column) {
   case 0: col0 = arg; break;
   case 1: col1 = arg; break;
 }
 throw new ArgumentError(column);
}
</pre>
</div>
</div>
<div class="method"><h4 id="+">
<button class="show-code">Code</button>
<a href="../vector_math/mat2.html">mat2</a> <strong>operator +</strong>(<a href="../vector_math/mat2.html">mat2</a> arg) <a class="anchor-link" href="#+"
              title="Permalink to mat2.operator +">#</a></h4>
<div class="doc">
<p>Returns new matrix after component wise <code>this</code> + 
<span class="param">arg</span></p>
<pre class="source">
mat2 operator+(mat2 arg) {
 mat2 r = new mat2.zero();
 r.col0.x = col0.x + arg.col0.x;
 r.col0.y = col0.y + arg.col0.y;
 r.col1.x = col1.x + arg.col1.x;
 r.col1.y = col1.y + arg.col1.y;
 return r;
}
</pre>
</div>
</div>
<div class="method"><h4 id="unary-">
<button class="show-code">Code</button>
<a href="../vector_math/mat2.html">mat2</a> <strong>operator -</strong>() <a class="anchor-link" href="#unary-"
              title="Permalink to mat2.operator -">#</a></h4>
<div class="doc">
<p>Returns new matrix -this</p>
<pre class="source">
mat2 operator-() {
 mat2 r = new mat2.zero();
 r[0] = -this[0];
 r[1] = -this[1];
 return r;
}
</pre>
</div>
</div>
<div class="method"><h4 id="-">
<button class="show-code">Code</button>
<a href="../vector_math/mat2.html">mat2</a> <strong>operator -</strong>(<a href="../vector_math/mat2.html">mat2</a> arg) <a class="anchor-link" href="#-"
              title="Permalink to mat2.operator -">#</a></h4>
<div class="doc">
<p>Returns new matrix after component wise <code>this</code> - 
<span class="param">arg</span></p>
<pre class="source">
mat2 operator-(mat2 arg) {
 mat2 r = new mat2.zero();
 r.col0.x = col0.x - arg.col0.x;
 r.col0.y = col0.y - arg.col0.y;
 r.col1.x = col1.x - arg.col1.x;
 r.col1.y = col1.y - arg.col1.y;
 return r;
}
</pre>
</div>
</div>
<div class="method"><h4 id="*">
<button class="show-code">Code</button>
<strong>operator *</strong>(arg) <a class="anchor-link" href="#*"
              title="Permalink to mat2.operator *">#</a></h4>
<div class="doc">
<p>Returns a new vector or matrix by multiplying <code>this</code> with 
<span class="param">arg</span>.</p>
<pre class="source">
dynamic operator*(dynamic arg) {
 if (arg is num) {
   mat2 r = new mat2.zero();
   r.col0.x = col0.x * arg;
   r.col0.y = col0.y * arg;
   r.col1.x = col1.x * arg;
   r.col1.y = col1.y * arg;
   return r;
 }
 if (arg is vec2) {
   vec2 r = new vec2.zero();
   r.x =  (this.col0.x * arg.x) + (this.col1.x * arg.y);
   r.y =  (this.col0.y * arg.x) + (this.col1.y * arg.y);
   return r;
 }
 if (2 == arg.rows) {
   dynamic r = null;
   if (arg.cols == 2) {
     r = new mat2.zero();
     r.col0.x =  (this.col0.x * arg.col0.x) + (this.col1.x * arg.col0.y);
     r.col1.x =  (this.col0.x * arg.col1.x) + (this.col1.x * arg.col1.y);
     r.col0.y =  (this.col0.y * arg.col0.x) + (this.col1.y * arg.col0.y);
     r.col1.y =  (this.col0.y * arg.col1.x) + (this.col1.y * arg.col1.y);
     return r;
   }
   return r;
 }
 throw new ArgumentError(arg);
}
</pre>
</div>
</div>
</div>
<div>
<h3>Methods</h3>
<div class="method"><h4 id="absolute">
<button class="show-code">Code</button>
<a href="../vector_math/mat2.html">mat2</a> <strong>absolute</strong>() <a class="anchor-link" href="#absolute"
              title="Permalink to mat2.absolute">#</a></h4>
<div class="doc">
<p>Returns the component wise absolute value of this.</p>
<pre class="source">
mat2 absolute() {
 mat2 r = new mat2.zero();
 r.col0.x = col0.x.abs();
 r.col0.y = col0.y.abs();
 r.col1.x = col1.x.abs();
 r.col1.y = col1.y.abs();
 return r;
}
</pre>
</div>
</div>
<div class="method"><h4 id="absoluteError">
<button class="show-code">Code</button>
double <strong>absoluteError</strong>(<a href="../vector_math/mat2.html">mat2</a> correct) <a class="anchor-link" href="#absoluteError"
              title="Permalink to mat2.absoluteError">#</a></h4>
<div class="doc">
<p>Returns absolute error between <code>this</code> and 
<span class="param">correct</span></p>
<pre class="source">
double absoluteError(mat2 correct) {
 double this_norm = infinityNorm();
 double correct_norm = correct.infinityNorm();
 double diff_norm = (this_norm - correct_norm).abs();
 return diff_norm;
}
</pre>
</div>
</div>
<div class="method"><h4 id="add">
<button class="show-code">Code</button>
<a href="../vector_math/mat2.html">mat2</a> <strong>add</strong>(<a href="../vector_math/mat2.html">mat2</a> o) <a class="anchor-link" href="#add"
              title="Permalink to mat2.add">#</a></h4>
<div class="doc">
<pre class="source">
mat2 add(mat2 o) {
 col0.x = col0.x + o.col0.x;
 col0.y = col0.y + o.col0.y;
 col1.x = col1.x + o.col1.x;
 col1.y = col1.y + o.col1.y;
 return this;
}
</pre>
</div>
</div>
<div class="method"><h4 id="clone">
<button class="show-code">Code</button>
<a href="../vector_math/mat2.html">mat2</a> <strong>clone</strong>() <a class="anchor-link" href="#clone"
              title="Permalink to mat2.clone">#</a></h4>
<div class="doc">
<pre class="source">
mat2 clone() {
 return new mat2.copy(this);
}
</pre>
</div>
</div>
<div class="method"><h4 id="copyFrom">
<button class="show-code">Code</button>
<a href="../vector_math/mat2.html">mat2</a> <strong>copyFrom</strong>(<a href="../vector_math/mat2.html">mat2</a> arg) <a class="anchor-link" href="#copyFrom"
              title="Permalink to mat2.copyFrom">#</a></h4>
<div class="doc">
<pre class="source">
mat2 copyFrom(mat2 arg) {
 col0.x = arg.col0.x;
 col0.y = arg.col0.y;
 col1.x = arg.col1.x;
 col1.y = arg.col1.y;
 return this;
}
</pre>
</div>
</div>
<div class="method"><h4 id="copyFromArray">
<button class="show-code">Code</button>
void <strong>copyFromArray</strong>(List&lt;num&gt; array, [int offset = 0]) <a class="anchor-link" href="#copyFromArray"
              title="Permalink to mat2.copyFromArray">#</a></h4>
<div class="doc">
<p>Copies elements from 
<span class="param">array</span> into <code>this</code> starting at 
<span class="param">offset</span>.</p>
<pre class="source">
void copyFromArray(List&lt;num&gt; array, [int offset=0]) {
 int i = offset;
 col0.x = array[i].toDouble();
 i++;
 col0.y = array[i].toDouble();
 i++;
 col1.x = array[i].toDouble();
 i++;
 col1.y = array[i].toDouble();
 i++;
}
</pre>
</div>
</div>
<div class="method"><h4 id="copyInto">
<button class="show-code">Code</button>
<a href="../vector_math/mat2.html">mat2</a> <strong>copyInto</strong>(<a href="../vector_math/mat2.html">mat2</a> arg) <a class="anchor-link" href="#copyInto"
              title="Permalink to mat2.copyInto">#</a></h4>
<div class="doc">
<pre class="source">
mat2 copyInto(mat2 arg) {
 arg.col0.x = col0.x;
 arg.col0.y = col0.y;
 arg.col1.x = col1.x;
 arg.col1.y = col1.y;
 return arg;
}
</pre>
</div>
</div>
<div class="method"><h4 id="copyIntoArray">
<button class="show-code">Code</button>
void <strong>copyIntoArray</strong>(List&lt;num&gt; array, [int offset = 0]) <a class="anchor-link" href="#copyIntoArray"
              title="Permalink to mat2.copyIntoArray">#</a></h4>
<div class="doc">
<p>Copies <code>this</code> into 
<span class="param">array</span> starting at 
<span class="param">offset</span>.</p>
<pre class="source">
void copyIntoArray(List&lt;num&gt; array, [int offset=0]) {
 int i = offset;
 array[i] = col0.x;
 i++;
 array[i] = col0.y;
 i++;
 array[i] = col1.x;
 i++;
 array[i] = col1.y;
 i++;
}
</pre>
</div>
</div>
<div class="method"><h4 id="determinant">
<button class="show-code">Code</button>
double <strong>determinant</strong>() <a class="anchor-link" href="#determinant"
              title="Permalink to mat2.determinant">#</a></h4>
<div class="doc">
<p>Returns the determinant of this matrix.</p>
<pre class="source">
double determinant() {
 return (col0.x * col1.y) - (col0.y*col1.x);
}
</pre>
</div>
</div>
<div class="method"><h4 id="getColumn">
<button class="show-code">Code</button>
<a href="../vector_math/vec2.html">vec2</a> <strong>getColumn</strong>(int column) <a class="anchor-link" href="#getColumn"
              title="Permalink to mat2.getColumn">#</a></h4>
<div class="doc">
<p>Gets the 
<span class="param">column</span> of the matrix</p>
<pre class="source">
vec2 getColumn(int column) {
 assert(column &gt;= 0 &amp;&amp; column &lt; 2);
 return new vec2.copy(this[column]);
}
</pre>
</div>
</div>
<div class="method"><h4 id="getRow">
<button class="show-code">Code</button>
<a href="../vector_math/vec2.html">vec2</a> <strong>getRow</strong>(int row) <a class="anchor-link" href="#getRow"
              title="Permalink to mat2.getRow">#</a></h4>
<div class="doc">
<p>Gets the 
<span class="param">row</span> of the matrix</p>
<pre class="source">
vec2 getRow(int row) {
 assert(row &gt;= 0 &amp;&amp; row &lt; 2);
 vec2 r = new vec2.zero();
 r.x = col0[row];
 r.y = col1[row];
 return r;
}
</pre>
</div>
</div>
<div class="method"><h4 id="infinityNorm">
<button class="show-code">Code</button>
double <strong>infinityNorm</strong>() <a class="anchor-link" href="#infinityNorm"
              title="Permalink to mat2.infinityNorm">#</a></h4>
<div class="doc">
<p>Returns infinity norm of the matrix. Used for numerical analysis.</p>
<pre class="source">
double infinityNorm() {
 double norm = 0.0;
 {
   double row_norm = 0.0;
   row_norm += this[0][0].abs();
   row_norm += this[0][1].abs();
   norm = row_norm &gt; norm ? row_norm : norm;
 }
 {
   double row_norm = 0.0;
   row_norm += this[1][0].abs();
   row_norm += this[1][1].abs();
   norm = row_norm &gt; norm ? row_norm : norm;
 }
 return norm;
}
</pre>
</div>
</div>
<div class="method"><h4 id="invert">
<button class="show-code">Code</button>
double <strong>invert</strong>() <a class="anchor-link" href="#invert"
              title="Permalink to mat2.invert">#</a></h4>
<div class="doc">
<p>Invert the matrix. Returns the determinant.</p>
<pre class="source">
double invert() {
 double det = determinant();
 if (det == 0.0) {
   return 0.0;
 }
 double invDet = 1.0 / det;
 double temp = col0.x;
 col0.x = col1.y * invDet;
 col0.y = - col0.y * invDet;
 col1.x = - col1.x * invDet;
 col1.y = temp * invDet;
 return det;
}
</pre>
</div>
</div>
<div class="method"><h4 id="multiply">
<button class="show-code">Code</button>
<a href="../vector_math/mat2.html">mat2</a> <strong>multiply</strong>(<a href="../vector_math/mat2.html">mat2</a> arg) <a class="anchor-link" href="#multiply"
              title="Permalink to mat2.multiply">#</a></h4>
<div class="doc">
<pre class="source">
mat2 multiply(mat2 arg) {
 final double m00 = col0.x;
 final double m01 = col1.x;
 final double m10 = col0.y;
 final double m11 = col1.y;
 final double n00 = arg.col0.x;
 final double n01 = arg.col1.x;
 final double n10 = arg.col0.y;
 final double n11 = arg.col1.y;
 col0.x =  (m00 * n00) + (m01 * n10);
 col1.x =  (m00 * n01) + (m01 * n11);
 col0.y =  (m10 * n00) + (m11 * n10);
 col1.y =  (m10 * n01) + (m11 * n11);
 return this;
}
</pre>
</div>
</div>
<div class="method"><h4 id="multiplyTranspose">
<button class="show-code">Code</button>
<a href="../vector_math/mat2.html">mat2</a> <strong>multiplyTranspose</strong>(<a href="../vector_math/mat2.html">mat2</a> arg) <a class="anchor-link" href="#multiplyTranspose"
              title="Permalink to mat2.multiplyTranspose">#</a></h4>
<div class="doc">
<pre class="source">
mat2 multiplyTranspose(mat2 arg) {
 double m00 = col0.x;
 double m01 = col1.x;
 double m10 = col0.y;
 double m11 = col1.y;
 col0.x =  (m00 * arg.col0.x) + (m01 * arg.col1.x);
 col1.x =  (m00 * arg.col0.y) + (m01 * arg.col1.y);
 col0.y =  (m10 * arg.col0.x) + (m11 * arg.col1.x);
 col1.y =  (m10 * arg.col0.y) + (m11 * arg.col1.y);
 return this;
}
</pre>
</div>
</div>
<div class="method"><h4 id="negate">
<button class="show-code">Code</button>
<a href="../vector_math/mat2.html">mat2</a> <strong>negate</strong>() <a class="anchor-link" href="#negate"
              title="Permalink to mat2.negate">#</a></h4>
<div class="doc">
<pre class="source">
mat2 negate() {
 col0.x = -col0.x;
 col0.y = -col0.y;
 col1.x = -col1.x;
 col1.y = -col1.y;
 return this;
}
</pre>
</div>
</div>
<div class="method"><h4 id="relativeError">
<button class="show-code">Code</button>
double <strong>relativeError</strong>(<a href="../vector_math/mat2.html">mat2</a> correct) <a class="anchor-link" href="#relativeError"
              title="Permalink to mat2.relativeError">#</a></h4>
<div class="doc">
<p>Returns relative error between <code>this</code> and 
<span class="param">correct</span></p>
<pre class="source">
double relativeError(mat2 correct) {
 mat2 diff = correct - this;
 double correct_norm = correct.infinityNorm();
 double diff_norm = diff.infinityNorm();
 return diff_norm/correct_norm;
}
</pre>
</div>
</div>
<div class="method"><h4 id="scaleAdjoint">
<button class="show-code">Code</button>
<a href="../vector_math/mat2.html">mat2</a> <strong>scaleAdjoint</strong>(num scale) <a class="anchor-link" href="#scaleAdjoint"
              title="Permalink to mat2.scaleAdjoint">#</a></h4>
<div class="doc">
<p>Converts into Adjugate matrix and scales by 
<span class="param">scale</span></p>
<pre class="source">
mat2 scaleAdjoint(num scale) {
 double scale_ = scale.toDouble();
 double temp = col0.x;
 col0.x = col1.y * scale_;
 col1.x = - col1.x * scale_;
 col0.y = - col0.y * scale_;
 col1.y = temp * scale_;
 return this;
}
</pre>
</div>
</div>
<div class="method"><h4 id="setColumn">
<button class="show-code">Code</button>
void <strong>setColumn</strong>(int column, <a href="../vector_math/vec2.html">vec2</a> arg) <a class="anchor-link" href="#setColumn"
              title="Permalink to mat2.setColumn">#</a></h4>
<div class="doc">
<p>Assigns the 
<span class="param">column</span> of the matrix 
<span class="param">arg</span></p>
<pre class="source">
void setColumn(int column, vec2 arg) {
 assert(column &gt;= 0 &amp;&amp; column &lt; 2);
 this[column] = arg;
}
</pre>
</div>
</div>
<div class="method"><h4 id="setIdentity">
<button class="show-code">Code</button>
<a href="../vector_math/mat2.html">mat2</a> <strong>setIdentity</strong>() <a class="anchor-link" href="#setIdentity"
              title="Permalink to mat2.setIdentity">#</a></h4>
<div class="doc">
<p>Makes <code>this</code> into the identity matrix.</p>
<pre class="source">
mat2 setIdentity() {
 col0.x = 1.0;
 col0.y = 0.0;
 col1.x = 0.0;
 col1.y = 1.0;
 return this;
}
</pre>
</div>
</div>
<div class="method"><h4 id="setRotation">
<button class="show-code">Code</button>
void <strong>setRotation</strong>(num radians) <a class="anchor-link" href="#setRotation"
              title="Permalink to mat2.setRotation">#</a></h4>
<div class="doc">
<p>Turns the matrix into a rotation of 
<span class="param">radians</span></p>
<pre class="source">
void setRotation(num radians) {
 double radians_ = radians.toDouble();
 double c = Math.cos(radians_);
 double s = Math.sin(radians_);
 col0.x = c;
 col0.y = s;
 col1.x = -s;
 col1.y = c;
}
</pre>
</div>
</div>
<div class="method"><h4 id="setRow">
<button class="show-code">Code</button>
void <strong>setRow</strong>(int row, <a href="../vector_math/vec2.html">vec2</a> arg) <a class="anchor-link" href="#setRow"
              title="Permalink to mat2.setRow">#</a></h4>
<div class="doc">
<p>Assigns the <code>column</code> of the matrix 
<span class="param">arg</span></p>
<pre class="source">
void setRow(int row, vec2 arg) {
 assert(row &gt;= 0 &amp;&amp; row &lt; 2);
 col0[row] = arg.x;
 col1[row] = arg.y;
}
</pre>
</div>
</div>
<div class="method"><h4 id="setZero">
<button class="show-code">Code</button>
<a href="../vector_math/mat2.html">mat2</a> <strong>setZero</strong>() <a class="anchor-link" href="#setZero"
              title="Permalink to mat2.setZero">#</a></h4>
<div class="doc">
<p>Zeros <code>this</code>.</p>
<pre class="source">
mat2 setZero() {
 col0.x = 0.0;
 col0.y = 0.0;
 col1.x = 0.0;
 col1.y = 0.0;
 return this;
}
</pre>
</div>
</div>
<div class="method"><h4 id="sub">
<button class="show-code">Code</button>
<a href="../vector_math/mat2.html">mat2</a> <strong>sub</strong>(<a href="../vector_math/mat2.html">mat2</a> o) <a class="anchor-link" href="#sub"
              title="Permalink to mat2.sub">#</a></h4>
<div class="doc">
<pre class="source">
mat2 sub(mat2 o) {
 col0.x = col0.x - o.col0.x;
 col0.y = col0.y - o.col0.y;
 col1.x = col1.x - o.col1.x;
 col1.y = col1.y - o.col1.y;
 return this;
}
</pre>
</div>
</div>
<div class="method"><h4 id="toString">
<button class="show-code">Code</button>
String <strong>toString</strong>() <a class="anchor-link" href="#toString"
              title="Permalink to mat2.toString">#</a></h4>
<div class="doc">
<p>Returns a printable string</p>
<pre class="source">
String toString() {
 String s = '';
 s = '$s[0] ${getRow(0)}\n';
 s = '$s[1] ${getRow(1)}\n';
 return s;
}
</pre>
</div>
</div>
<div class="method"><h4 id="trace">
<button class="show-code">Code</button>
double <strong>trace</strong>() <a class="anchor-link" href="#trace"
              title="Permalink to mat2.trace">#</a></h4>
<div class="doc">
<p>Returns the trace of the matrix. The trace of a matrix is the sum of the diagonal entries</p>
<pre class="source">
double trace() {
 double t = 0.0;
 t += col0.x;
 t += col1.y;
 return t;
}
</pre>
</div>
</div>
<div class="method"><h4 id="transform">
<button class="show-code">Code</button>
<a href="../vector_math/vec2.html">vec2</a> <strong>transform</strong>(<a href="../vector_math/vec2.html">vec2</a> arg) <a class="anchor-link" href="#transform"
              title="Permalink to mat2.transform">#</a></h4>
<div class="doc">
<pre class="source">
vec2 transform(vec2 arg) {
 double x_ =  (this.col0.x * arg.x) + (this.col1.x * arg.y);
 double y_ =  (this.col0.y * arg.x) + (this.col1.y * arg.y);
 arg.x = x_;
 arg.y = y_;
 return arg;
}
</pre>
</div>
</div>
<div class="method"><h4 id="transformed">
<button class="show-code">Code</button>
<a href="../vector_math/vec2.html">vec2</a> <strong>transformed</strong>(<a href="../vector_math/vec2.html">vec2</a> arg, [<a href="../vector_math/vec2.html">vec2</a> out = null]) <a class="anchor-link" href="#transformed"
              title="Permalink to mat2.transformed">#</a></h4>
<div class="doc">
<pre class="source">
vec2 transformed(vec2 arg, [vec2 out=null]) {
 if (out == null) {
   out = new vec2.copy(arg);
 } else {
   out.copyFrom(arg);
 }
 return transform(out);
}
</pre>
</div>
</div>
<div class="method"><h4 id="transpose">
<button class="show-code">Code</button>
<a href="../vector_math/mat2.html">mat2</a> <strong>transpose</strong>() <a class="anchor-link" href="#transpose"
              title="Permalink to mat2.transpose">#</a></h4>
<div class="doc">
<pre class="source">
mat2 transpose() {
 double temp;
 temp = col1.x;
 col1.x = col0.y;
 col0.y = temp;
 return this;
}
</pre>
</div>
</div>
<div class="method"><h4 id="transposed">
<button class="show-code">Code</button>
<a href="../vector_math/mat2.html">mat2</a> <strong>transposed</strong>() <a class="anchor-link" href="#transposed"
              title="Permalink to mat2.transposed">#</a></h4>
<div class="doc">
<p>Returns the tranpose of this.</p>
<pre class="source">
mat2 transposed() {
 mat2 r = new mat2.zero();
 r.col0.x = col0.x;
 r.col0.y = col1.x;
 r.col1.x = col0.y;
 r.col1.y = col1.y;
 return r;
}
</pre>
</div>
</div>
<div class="method"><h4 id="transposeMultiply">
<button class="show-code">Code</button>
<a href="../vector_math/mat2.html">mat2</a> <strong>transposeMultiply</strong>(<a href="../vector_math/mat2.html">mat2</a> arg) <a class="anchor-link" href="#transposeMultiply"
              title="Permalink to mat2.transposeMultiply">#</a></h4>
<div class="doc">
<pre class="source">
mat2 transposeMultiply(mat2 arg) {
 double m00 = col0.x;
 double m01 = col0.y;
 double m10 = col1.x;
 double m11 = col1.y;
 col0.x =  (m00 * arg.col0.x) + (m01 * arg.col0.y);
 col1.x =  (m00 * arg.col1.x) + (m01 * arg.col1.y);
 col0.y =  (m10 * arg.col0.x) + (m11 * arg.col0.y);
 col1.y =  (m10 * arg.col1.x) + (m11 * arg.col1.y);
 return this;
}
</pre>
</div>
</div>
</div>
        </div>
        <div class="clear"></div>
        </div>
        <div class="footer">
          
        </div>
        <script async src="../client-live-nav.js"></script>
        </body></html>
        
